﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp" %>
<c:if test="${fn:length(dependencies)>0}">
		<table id="dependency">
			<tr>
				<th rowspan="2">Submitter</th>
				<th rowspan="2">Description</th>
				<th rowspan="2">Keys</th>
				<th rowspan="2">Parameters</th>
				<th colspan="5">Dependency Jobs</th>
				<th rowspan="2">Create<br>Time</th>
				<th rowspan="2">Action</th>
			</tr>
			<tr>
				<th>Type</th>
				<th>Name</th>
				<th>Description</th>
				<th>Keys</th>
				<th>Conditions</th>
			</tr>
<c:forEach var="dep" items="${dependencies}">
	<c:forEach var="item" items="${dep.dependencies}" varStatus="vs">
		<c:set var="itemConf" value="${ss:getJobConf(jobConfController, item.identifier)}" />
		<c:choose>
		<c:when test="${vs.index==0}">
			<tr valign="top">
				<td rowspan="${dep.dependencySize}">${dep.owner}</td>
				<td rowspan="${dep.dependencySize}">${dep.description}</td>
				<td rowspan="${dep.dependencySize}"><c:forEach var="key" items="${dep.keys}" varStatus="vsk"><c:if test="${vsk.index>0}"><BR></c:if>${key}</c:forEach></td>
				<td rowspan="${dep.dependencySize}"><c:forEach var="key" items='${dep.parameters}' varStatus="vsk"><c:if test="${vsk.index>0}"><BR></c:if>${key}</c:forEach></td>
				<td>${itemConf.type}</td>
				<td><a href="job-conf.action?action=view&identifier=${itemConf.identifier.stringIdentifier}">${itemConf.name}</a></td>
				<td>${itemConf.description}</td>
				<td><c:forEach var="key" items="${dep.keys}" varStatus="vsk"><c:if test="${vsk.index>0}"><BR></c:if>${key}=${item.parameters[key]}</c:forEach></td>
				<td>${item.condition}</td>
				<td rowspan="${dep.dependencySize}">${ss:dateFormat(dep.createTime)}</td>
				<td rowspan="${dep.dependencySize}">
					<a href="run-job-conf.action?action=createDependency&dependencyIdentifier=${dep.identifier.stringIdentifier}"><img alt="以此为模板创建" src="images/icons/add.png" title="以此为模板创建"></a>
					<a href="run-job-conf.action?action=removeDependency&dependencyIdentifier=${dep.identifier.stringIdentifier}"><img alt="删除依赖触发" src="images/icons/remove.jpg" title="删除依赖触发"></a>
				</td>
			</tr>
		</c:when>
		<c:otherwise>
			<tr>
				<td>${itemConf.type}</td>
				<td><a href="job-conf.action?action=view&identifier=${itemConf.identifier.stringIdentifier}">${itemConf.name}</a></td>
				<td>${itemConf.description}</td>
				<td><c:forEach var="key" items="${dep.keys}" varStatus="vsk"><c:if test="${vsk.index>0}"><BR></c:if>${key}=${item.parameters[key]}</c:forEach></td>
				<td>${item.condition}</td>
			</tr>
		</c:otherwise>
	</c:choose></c:forEach>
</c:forEach>
		</table>
</c:if>